package in.muton.wicket.model;

import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.model.IModel;

@Deprecated
public class CayenneModelList<T> implements IModel<List<IModel<T>>> {
	private static final long serialVersionUID = -3568923633265128913L;
	List<IModel<T>> listObject;
	public CayenneModelList(List<IModel<T>> obj){
		listObject = obj;
	}
	
	public CayenneModelList(){
		listObject = new ArrayList<IModel<T>>();
	}
	
	public CayenneModelList<T> getCayenneModelList(List<T> obj){
		List<IModel<T>> newList = new ArrayList<IModel<T>>();
		for(T t:obj){
			newList.add(new CayenneGenericModel<T>(t));
		}
		return new CayenneModelList<T>(newList);
	}
	
	public List<IModel<T>> getObject() {
		return listObject;
	}

	public void setObject(List<IModel<T>> object) {
		listObject = object;
	}
	public void detach() {}
}
